/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 abstract_adv_actor.h

	$Header: /heroes4/abstract_adv_actor.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( ABSTRACT_ADV_ACTOR_H_INCLUDED )
#define ABSTRACT_ADV_ACTOR_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "abstract_adv_object.h"
#include "copy_on_write_ptr.h"

class t_adv_actor_model;
enum  t_player_color;

// --------------------------------------------------------------------------
// Details namespace
// --------------------------------------------------------------------------

namespace abstract_adv_actor_details
{

	class t_impl;

} // Details namespace

// --------------------------------------------------------------------------
// t_abstract_adv_actor class
// --------------------------------------------------------------------------

class t_abstract_adv_actor : public virtual t_abstract_adv_object
{
public:
	// Types
	typedef t_adv_actor_model	t_model;

	// Constructors/Destructor
	t_abstract_adv_actor();
	t_abstract_adv_actor( t_abstract_adv_actor const & other );
	virtual ~t_abstract_adv_actor();

	// Member functions
	virtual void				accept( t_visitor & visitor );
	virtual void				accept( t_visitor & visitor ) const;
	virtual bool				animates() const;
	virtual void				draw_subimage_to(
									int						subimage_num,
									t_uint32				current_time,
									t_screen_rect const &	source_rect, 
									t_abstract_bitmap16 &	dest, 
									t_screen_point const &	dest_point,
									int						alpha = 15 ) const;
	virtual void				draw_subimage_to(
									int						subimage_num,
									t_uint32				current_time, 
									t_abstract_bitmap16 &	dest, 
									t_screen_point const &	dest_point ) const;
	virtual void				draw_to(
									t_uint32				current_time, 
									t_screen_rect const &	source_rect,
									t_abstract_bitmap16 &	dest, 
									t_screen_point const &	dest_point ) const;
	virtual void				draw_to(
									t_uint32				current_time, 
									t_abstract_bitmap16 &	dest, 
									t_screen_point const &	dest_point ) const;
	void						enable_highlight( bool enable );
	t_player_color				get_flag_color() const;
	virtual t_footprint const &	get_footprint() const;
	virtual t_screen_point		get_frame_offset() const;
	virtual t_model const &		get_model() const = 0;
	virtual t_screen_rect		get_rect() const;
	virtual t_screen_rect		get_rect( t_uint32 current_time ) const;
	virtual int					get_subimage_count() const;
	virtual int					get_subimage_depth_offset( int subimage_num ) const;
	virtual t_screen_rect		get_subimage_rect( int subimage_num ) const;
	virtual t_screen_rect		get_subimage_rect(
									int			subimage_num,
									t_uint32	time ) const;
	virtual bool				hit_test(
									t_uint32				current_time,
									t_screen_point const &	point ) const;
	bool						is_highlighted() const;
	virtual bool				needs_redrawing(
									t_uint32	last_update_time,
									t_uint32	current_time ) const;
	virtual bool				subimage_animates( int subimage_num ) const;
	virtual bool				subimage_is_underlay( int subimage_num ) const;
	virtual bool				subimage_needs_redrawing(
									int			subimage_num,
									t_uint32	last_update_time,
									t_uint32	current_time ) const;
	virtual bool				visible_through_obstacles( int subimage_num ) const;

	// Operator
	t_abstract_adv_actor &	operator=( t_abstract_adv_actor const & other );

protected:
	// Member functions
	virtual void	on_model_changed();
	void			set_flag_color( t_player_color new_flag_color );

private:
	// Types
	typedef abstract_adv_actor_details::t_impl t_impl;
	friend class abstract_adv_actor_details::t_impl;

	// Data members
	t_copy_on_write_ptr< t_impl >	m_impl_ptr;

	// Member functions
	virtual bool			do_animates() const = 0;
	virtual void			do_draw_to(
								t_uint32				current_time, 
								t_screen_rect const &	source_rect,
								t_abstract_bitmap16 &	dest, 
								t_screen_point const &	dest_point,
								int						alpha = 15 ) const = 0;
	virtual void			do_draw_to(
								t_uint32				current_time, 
								t_abstract_bitmap16 &	dest, 
								t_screen_point const &	dest_point ) const = 0;
	virtual t_screen_rect	do_get_rect() const = 0;
	virtual t_screen_rect	do_get_rect( t_uint32 current_time ) const = 0;
	virtual bool			do_hit_test(
								t_uint32				current_time,
								t_screen_point const &	point ) const = 0;
	virtual bool			do_needs_redrawing(
								t_uint32	last_update_time,
								t_uint32	current_time ) const = 0;
	virtual bool			do_visible_through_obstacles() const;
};

#endif // !defined( ABSTRACT_ADV_ACTOR_H_INCLUDED )
